package com.ml.mall.service.asyn;

import com.ml.mall.bean.req.BaseDateRangeReq;
import com.ml.mall.bean.req.admin.purchase.PurchaseQueryReportPageReq;
import com.ml.mall.bean.res.admin.category.AdminCategoryQueryPageRes;
import com.ml.mall.bean.res.partner.PartnerSupplierQueryPageRes;
import com.ml.mall.bean.res.supplier.SupplierVariantQueryPageRes;
import com.ml.mall.bean.vo.DateValueVO;
import com.ml.mall.mapper.AnalyticsPartnerMapper;
import com.ml.mall.mapper.AnalyticsSupplierMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;
import java.util.concurrent.Future;

/**
 * Created by kyyang on 2021/6/8 22:32
 */
@Component
public class AnalyticsSupplierServiceAsyn {


    @Autowired
    private AnalyticsSupplierMapper analyticsSupplierMapper;


    /**
     * @description: 查询某一买家 消费一级目录 总记录数
     * @author kyyang
     * @date 2021/7/3 14:59
     * @version 1.0
     */
    @Async
    public Future<Integer> selectSupplierVariantQueryPageCount(String timeBegin, String timeEnd, int sortType, Long companyId,Long supplierId) {
        Integer count =  analyticsSupplierMapper.selectSupplierVariantQueryPageCount(timeBegin,timeEnd,companyId,supplierId);
        return new AsyncResult<>(count);

    }

    /**
     * @description: 查询某一买家 消费一级目录 记录明细
     * @author kyyang
     * @date 2021/7/3 14:59
     * @version 1.0
     */
    @Async
    public Future<List<SupplierVariantQueryPageRes>> selectSupplierVariantQueryPageList(String timeBegin, String timeEnd, int sortType, Long companyId,Long supplierId, int start, int end) {
        List<SupplierVariantQueryPageRes> list =  analyticsSupplierMapper.selectSupplierVariantQueryPageList(timeBegin,timeEnd,sortType,companyId,supplierId,start,end);
        return new AsyncResult<>(list);
    }


}
